package il.ac.tau.cvws.scrabblesidekick.client.ui.view.dialog;

import il.ac.tau.cvws.scrabblesidekick.client.ui.constant.UserMessageConstant;
import il.ac.tau.cvws.scrabblesidekick.client.ui.service.UIServices;
import android.app.Dialog;
import android.content.Context;

/* Handler class for progress dialogs.
 */
public class ProgressDialogHandler
{
	private Dialog _progressDialog = null;
	
	/* Displays a progress bar, and displays a message to the waiting user.
	 */
	public void showProgressBar(Context context)
	{
		_progressDialog = UIServices.createProgressDialog(context, UserMessageConstant.WAITING);
		_progressDialog.show();
	}
	
	/* Hides the progress bar (if it was ever displayed).
	 */
	public void hideProgressBar()
	{
		if (_progressDialog == null)
		{
			return;
		}
		
		_progressDialog.cancel();
	}
}
